3 research outputs found

    A solution for synchronous incremental maintenance of materialized views based on SQL recursive query

    Get PDF
    Materialized views are excessively stored query execution results in the database. They can be used to partially or completely answer queries which will be further appeared instead of re-executing query from the scratch. There is a large number of published works that address the maintenance, especially incremental update, of materialized views and query rewriting for using those ones. Some of them support materialized views based on recursive query in datalog language. Although most of datalog queries can be transferred into SQL queries and vise versa but it is not the case for recursive queries. Recursive queries in the data log try to find all possible transitive closures. Recursive queries in SQL (Common Table Expression – CTE) return direct links but not transitive closures. In this paper, we propose efficient methods for incremental update of materialized views based on CTE; and then propose an algorithm for generating source codes in C language for any input SQL recursive queries. The synthesized source codes implement our proposed incremental update algorithms according to inserted/deleted/updated record set in the base tables. This paper focuses mainly on the recursive queries whose execution results are directed tree-structured data. The two cases of tree node are considered. In the first case, a child node has only one parent node and in the second case, a child node can have many parent nodes. Those two cases represent the two types of relationships between entities in real world, that are one–to–many and many–to–many, respectively. For the one–to–many relationships, the relationship data is accompanied with the records describing the child using some fields. Those fields are set as null in deleting a concrete relationship. For the many–to–many relationships, it is stored in a separate table and the concrete relationships are removed by deleting describing records from that table. Considering of enforcing referential integrity may help to reduce the searching space and therefore, help to improve the performance. However, the set of tree nodes or tree edges can be manipulated. All those combinations lead to different algorithms. The experimental results are provided and discussed to confirm the effectiveness of our proposed method

    A solution for synchronous incremental maintenance of materialized views based on SQL recursive query

    Get PDF
    Materialized views are excessively stored query execution results in the database. They can be used to partially or completely answer queries which will be further appeared instead of re-executing query from the scratch. There is a large number of published works that address the maintenance, especially incremental update, of materialized views and query rewriting for using those ones. Some of them support materialized views based on recursive query in datalog language. Although most of datalog queries can be transferred into SQL queries and vise versa but it is not the case for recursive queries. Recursive queries in the data log try to find all possible transitive closures. Recursive queries in SQL (Common Table Expression – CTE) return direct links but not transitive closures. In this paper, we propose efficient methods for incremental update of materialized views based on CTE; and then propose an algorithm for generating source codes in C language for any input SQL recursive queries. The synthesized source codes implement our proposed incremental update algorithms according to inserted/deleted/updated record set in the base tables. This paper focuses mainly on the recursive queries whose execution results are directed tree-structured data. The two cases of tree node are considered. In the first case, a child node has only one parent node and in the second case, a child node can have many parent nodes. Those two cases represent the two types of relationships between entities in real world, that are one–to–many and many–to–many, respectively. For the one–to–many relationships, the relationship data is accompanied with the records describing the child using some fields. Those fields are set as null in deleting a concrete relationship. For the many–to–many relationships, it is stored in a separate table and the concrete relationships are removed by deleting describing records from that table. Considering of enforcing referential integrity may help to reduce the searching space and therefore, help to improve the performance. However, the set of tree nodes or tree edges can be manipulated. All those combinations lead to different algorithms. The experimental results are provided and discussed to confirm the effectiveness of our proposed method

    Нове рішення для асинхронного інкрементного обслуговування матеріалізованих представлень

    No full text
    Materialized views can help improve query execution speed dramatically using full or part of stored precalculated query results. Incremental maintenance takes materialized views up-to-date adjusting them accordingly to the changes in related base tables. It is often more effective than a full refresh replacing materialized view tables by the new query execution result. Asynchronous maintenance, which brings the materialized views to the actual state, is not a constituent of the transaction making changes in the base tables. Most of the published works are dedicated to synchronous incremental updating of views, algorithms for which require accessing the pre-update state of base tables and cannot be applied directly to asynchronous updates which are performed on the post-update state. A few works are devoted to asynchronous maintenance of views, either restrict changes in only one of base tables or assume there is only one base table, which is impractical, either is wrong, either provides too high level and complex incremental update algorithms or can be implemented only if the database management system supports data versioning at the table and row levels. In this paper, we propose a solution for the asynchronous incremental update of views which can be implemented with any database management systems. We collect changes in base tables, access the pre-update state of base tables exploiting the condensing process and apply the pre-update incremental maintenance algorithms for asynchronous maintenance on the post-update state of base tables considering the specifics of asynchronous maintenance. It is applicable for SPJ queries with inner joins, queries with inner joins and aggregations. We also build a prototype and provide experiments on automatic generating source codes in C to collect changes in base tables and to perform the asynchronous incremental update of materialized views in PostgreSQLМатериализованные представления могут значительно повысить скорость выполнения запросов, используя все или часть сохраненных предварительно вычисленных результатов запросов. При инкрементном обслуживании материализованные представления обновляются в соответствии с изменениями в соответствующих базовых таблицах. Часто это более эффективно, чем полное обновление, заменяющее таблицы материализованных представлений новым результатом выполнения запроса. Асинхронное обслуживание, приводящее материализованные представления в фактическое состояние, не является составной частью транзакции, вносящей изменения в базовые таблицы. Большинство опубликованных работ посвящено синхронному инкрементному обновлению представлений, алгоритмы которого требуют доступа к состоянию базовых таблиц перед обновлением и не могут применяться непосредственно к асинхронным обновлениям, которые выполняются в состоянии после обновления. Несколько работ посвящено асинхронному обслуживанию представлений, либо ограничивают изменения только в одной из базовых таблиц, либо предусматривают наличие только одной базовой таблицы, что нецелесообразно, либо неверно, либо предоставляет слишком высокий уровень и сложные алгоритмы инкрементного обновления, либо может быть реализовано, только если система управления базами данных поддерживает управление версиями данных на уровне таблиц и строк. В данной работе предложено решение для асинхронного инкрементного обновления представлений, которое может быть реализовано с любыми системами управления базами данных. Мы собираем изменения в базовых таблицах, получаем доступ к состоянию перед обновлением базовых таблиц, используя процесс уплотнения, и применяем алгоритмы инкрементного обслуживания перед обновлением для асинхронного обслуживания к состоянию базовых таблиц после обновления, учитывая особенности асинхронного обслуживания. Это применимо для запросов SPJ с внутренними соединениями, запросов с внутренними соединениями и агрегатами. Создан прототип и приведены эксперименты по автоматической генерации исходных кодов на языке Си для сбора изменений в базовых таблицах и выполнения асинхронного инкрементного обновления материализованных представлений в PostgreSQLМатерiалiзованi представлення можуть значно пiдвищити швидкiсть виконання запитiв, використовуючи всi або частину збережених попередньо обчислених результатiв запитiв. При iнкрементному обслуговуваннi матерiалiзованi представлення оновлюються вiдповiдно до змiн у вiдповiдних базових таблицях. Часто це бiльш ефективно, нiж повне оновлення, що замiнює таблицi матерiалiзованих уявлень новим результатом виконання запиту. Асинхронне обслуговування, що приводить матерiалiзованi представлення до фактичного стану, не є складовою частиною транзакцiї, що вносить змiни в базовi таблицi. Бiльшiсть опублiкованих робiт присвячено синхронному iнкрементному оновленню представлень, алгоритми якого вимагають доступу до стану базових таблиць перед оновленням i не можуть застосовуватися безпосередньо до асинхронним оновлень, якi виконуються в станi пiсля оновлення. Кiлька робiт присвячено асинхронному обслуговуванню представлень, або обмежують змiни тiльки в однiй з базових таблиць, або передбачають наявнiсть лише однiєї базової таблицi, що недоцiльно, або невiрно, або надає занадто високий рiвень i складнi алгоритми iнкрементного оновлення, або може бути реалiзовано, тiльки якщо система управлiння базами даних пiдтримує управлiння версiями даних на рiвнi таблиць i рядкiв. У данiй роботi запропоноване рiшення для асинхронного iнкрементного оновлення представлень, яке може бути реалiзовано з будь-якими системами управлiння базами даних. Ми збираємо змiни в базових таблицях, отримуємо доступ до стану перед оновленням базових таблиць, використовуючи процес ущiльнення, i застосовуємо алгоритми iнкрементного обслуговування перед оновленням для асинхронного обслуговування до стану базових таблиць пiсля оновлення, враховуючи особливостi асинхронного обслуговування. Це може бути застосовано для запитiв SPJ з внутрiшнiми з'єднаннями, запитiв з внутрiшнiми з'єднаннями i агрегатами. Створено прототип та наведено експерименти з автоматичної генерацiї вихiдних кодiв на мовi Сi для збору змiн в базових таблицях i виконання асинхронного iнкрементного оновлення матерiалiзованих представлень в PostgreSQ
    corecore